package com.ngo.exception;

public class BaseException extends RuntimeException {
	private static final long serialVersionUID = -6448182009441467060L;
	// 自动以错误编码和描述
	private String code;
	private String desc;

	public BaseException(String desc) {
		this(null, desc);
	}

	public BaseException(String code, String desc) {
		super(desc);
		this.code = code;
		this.desc = desc;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public static BaseException create(String desc) {
		return new BaseException(desc);
	}

	public static BaseException create(String code, String desc) {
		return new BaseException(code, desc);
	}

}
